package org.springframework.samples.petclinic.model.usrAccount;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;
import org.springframework.samples.petclinic.model.owner.Owner;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Vector;

public interface AccountRepository extends Repository<Account,String> {
	@Query("SELECT account.usrPassword FROM Account account WHERE account.accountName=:accountName")
	@Transactional(readOnly = true)
	String findPassword(@Param("accountName")String accountName);

//	@Query("SELECT account FROM Account account WHERE account.accountName=:accountName")
//	@Transactional(readOnly = true)
	List<Account> findByAccountName(@Param("accountName")String accountName);

	void save(Account account);
}
